<?php
/**
 * Author：晴天 QQ：1186258278
 * Creation：2020/3/21 13:08
 * Filename：checkstandM.php
 * 购物车收银台！
 */
if (!defined('IN_CRONLITE')) die();
$USERDATA = login_data::user_data();
if (empty($_QET['arr'])) show_msg('温馨提示', '参数缺失', 3);
$Array = json_decode(xiaochu_de($_QET['arr']), true);
if (count($Array) == 0) show_msg('温馨提示', '最少选择一个商品哦！', 3);
$DataUser = login_data::user_data();
global $cdnserver;
$DataList = implode('|', $Array);
$PayArray = explode(',', $conf['CartPaySet']);
$Url = is_https(false) . href() . $_SERVER['REQUEST_URI'];
$Url = str_replace("CartCheckstandPC", "CartCheckstandM", $Url);
?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title><?= '购物车结算 - ' . $conf['sitename'] . ($conf['title'] == '' ? '' : ' - ' . $conf['title']) ?></title>
    <meta name="keywords" content="<?= $conf['keywords'] ?>">
    <meta name="description" content="<?= $conf['description'] ?>">
    <link rel="stylesheet" type="text/css" href="<?php echo $cdnserver; ?>assets/layui/css/layui.css"/>
    <link href="<?php echo $cdnpublic ?>limonte-sweetalert2/7.33.1/sweetalert2.min.css" rel="stylesheet">
    <link href="<?php echo $cdnpublic ?>animate.css/3.7.2/animate.min.css" rel="stylesheet">
</head>
<style>
    .information {
        font-size: 0.9em;
        color: black
    }
</style>
<script>
    if (window.innerWidth < 645) {
        window.location.href = '<?=$Url?>';
    }
</script>
<body style="<?= background::image() == false ? 'background:#f5f5f5;' : background::image() ?>;overflow-x: hidden;padding: 1em;font-family: '微软雅黑 Light'"
      cartkey="<?= (empty($_COOKIE['CartKey']) && $USERDATA == false ? (strlen($_QET['CartKey']) <> 32 ? '-1' : $_QET['CartKey']) : '-1') ?>">
<div class="layui-container" style="padding: 0;margin-top: 1em;">
    <div class="layui-row layui-col-space8">
        <div class="layui-col-sm12" style="padding: 0em;">
            <div class="layui-card" style="border-radius: 0.5em">
                <div class="layui-card-header">
                    <a href="?mod=cart">
                        <p style="margin-top: 0.5em;font-size: 1.2em"><span
                                    class="layui-icon layui-icon-left"></span> 确认订单</p>
                    </a>
                </div>
                <div class="layui-card" style="border-radius: 0.5em">
                    <div class="layui-row layui-col-space8">
                        <div class="layui-col-xs2">
                            <div style="border-radius: 0.5em;width: 3em;text-align: center;height: 3em;line-height: 3em;color:white;margin: 0.8em;box-shadow: 3px 3px 16px #eee">
                                <img src="<?= $conf['logo'] ?>"
                                     width="35"/>
                            </div>
                        </div>
                        <div class="layui-col-xs10">
                            <div class="layui-card-header" style="font-size: 1.1em;font-family: '微软雅黑 Light'">
                                <?= $conf['sitename'] . ' - ' . $conf['title'] ?>
                            </div>
                            <div class="layui-card-body information">
                                <?= $conf['CartNotice'] ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="Content" class="layui-row layui-col-space8"></div>

        <div class="layui-col-sm12" style="margin-top: 0.5em;">
            <div class="layui-card" style="border-radius: 0.5em">
                <div class="layui-card-body layui-form layui-form-pane" style="padding: 0.5em">
                    <div style="padding: 0.3em;border-radius: 0.3em;line-height: 2em;height: 2.5em;">
                        <input type="radio" name="pay"
                               <?= (in_array(1, $PayArray) && $conf['pay_alipay'] <> -1 ? '' : 'disabled') ?>
                               value="1"
                               title="<p style='width:100%'><img src='/assets/img/alipay.png' width='13px' /> 支付宝</p>">
                    </div>
                    <div style="padding: 0.3em;border-radius: 0.3em;line-height: 2em;height: 2.5em;">
                        <input type="radio" name="pay"
                               <?= (in_array(2, $PayArray) && $conf['pay_wxpay'] <> -1 ? '' : 'disabled') ?> value="2"
                               title="<p style='width:100%'><img src='/assets/img/wxpay.png' width='13px' /> 微信</p>">
                    </div>
                    <div style="padding: 0.3em;border-radius: 0.3em;line-height: 2em;height: 2.5em;">
                        <input type="radio" name="pay"
                               <?= (in_array(3, $PayArray) && $conf['pay_qqpay'] <> -1 ? '' : 'disabled') ?> value="3"
                               title="<p style='width:100%'><img src='/assets/img/qqpay.png' width='13px' /> QQ钱包</p>">
                    </div>
                    <div style="padding: 0.3em;border-radius: 0.3em;line-height: 2em;height: 2.5em;">
                        <input type="radio" name="pay"
                               <?= (in_array(4, $PayArray) && $USERDATA <> false ? '' : 'disabled') ?> value="4"
                               title="<p style='width:100%'><img src='/assets/img/moneypay.png' width='13px' /> 余额 <span style='color:#999;font-size:0.8em;margin-left:1em'><?= ($DataUser == false ? '未登陆无法使用' : '剩' . round($DataUser['money'], 2) . '元') ?></span></p>">
                    </div>
                    <div style="padding: 0.3em;border-radius: 0.3em;line-height: 2em;height: 2.5em">
                        <input type="radio" name="pay"
                               <?= (in_array(5, $PayArray) && $USERDATA <> false ? '' : 'disabled') ?> value="5"
                               title="<p style='width:100%'><img src='/assets/img/total.png' width='13px' /> <?= $conf['currency'] ?> <span style='color:#999;font-size:0.8em;margin-left:1em'><?= ($DataUser == false ? '未登陆无法使用' : '剩' . round($DataUser['currency'], 0) . $conf['currency']) ?></span></p>">
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-col-sm12">
            <div class="layui-card" style="border-radius: 0.5em">
                <div class="layui-card-body"
                     style="padding: 0;height: 4em;line-height: 4em;text-align: right;border-radius: 0.8em">
                    <button class="layui-btn layui-btn-danger layui-btn-radius" type="submit"
                            onclick="GoodsCart.PaySubmit('<?= $DataList ?>')"
                            style="float: right;margin:0.5em 1em 0 1em;background: linear-gradient(to right, #f85032, #e73827);margin-right: 0.5em;">
                        提交订单
                    </button>
                    <span style="font-size: 1.2em;float: right;text-indent: 0.5em"><span
                                style="color: #A6A6A6;font-size: 0.9em">共<span id="sum"></span>份，</span><span>合计：</span><font
                                color="#ff4500">￥<span id="Price">0</span>元</font></span>

                </div>
            </div>
        </div>
    </div>
</div>

<script src="<?= $cdnpublic ?>jquery/3.4.1/jquery.min.js"></script>
<script src="<?php echo $cdnserver; ?>assets/layui/layui.all.js"></script>
<script src="<?php echo $cdnpublic ?>limonte-sweetalert2/7.33.1/sweetalert2.min.js"></script>
<script type="text/javascript" src="http://www.jq22.com/demo/copy20161120/dist/clipboard.min.js"></script>
<script src="/assets/js/cart.js?var=<?= $accredit['versions'] ?>"></script>
<script>
    GoodsCart.PaySrt('<?=$DataList?>');
</script>
</body>
</html>
